/*      */ package com.yc.dao.importdata;
/*      */ 
/*      */ import com.yc.dao.model.AcdcDistributionBO;
/*      */ import com.yc.dao.model.AirconditionBO;
/*      */ import com.yc.dao.model.AntennaFeederBO;
/*      */ import com.yc.dao.model.BTSNewBO;
/*      */ import com.yc.dao.model.BathunderBO;
/*      */ import com.yc.dao.model.DynamoBO;
/*      */ import com.yc.dao.model.EnvMontorBO;
/*      */ import com.yc.dao.model.FiberInfoBO;
/*      */ import com.yc.dao.model.FiberUsedInfoBO;
/*      */ import com.yc.dao.model.FireExtinGuisherBO;
/*      */ import com.yc.dao.model.GeographicalenvBo;
/*      */ import com.yc.dao.model.IronTowerBO;
/*      */ import com.yc.dao.model.MachineRoomBO;
/*      */ import com.yc.dao.model.MagnifierBO;
/*      */ import com.yc.dao.model.MainssupplyBO;
/*      */ import com.yc.dao.model.PowerBoxBO;
/*      */ import com.yc.dao.model.PowerSupplyBO;
/*      */ import com.yc.dao.model.SectionInfoBo;
/*      */ import com.yc.dao.model.SectionOutInfoBO;
/*      */ import com.yc.dao.model.StoragebatteryBO;
/*      */ import com.yc.dao.model.TrafficInfoBO;
/*      */ import com.yc.dao.model.TransfersBO;
/*      */ import com.yc.dao.model.TransformerBO;
/*      */ import com.yc.dao.model.UsedFiberMapBO;
/*      */ import java.io.PrintStream;
/*      */ import java.sql.Connection;
/*      */ import java.sql.DriverManager;
/*      */ import java.sql.ResultSet;
/*      */ import java.sql.SQLException;
/*      */ import java.sql.Statement;
/*      */ import java.text.SimpleDateFormat;
/*      */ import java.util.ArrayList;
/*      */ import java.util.Date;
/*      */ import java.util.List;
/*      */ import org.apache.commons.logging.Log;
/*      */ import org.apache.commons.logging.LogFactory;
/*      */ 
/*      */ public class ImportDAO
/*      */ {
/*   44 */   private static final Log log = LogFactory.getLog(ImportDAO.class);
/*   45 */   private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
/*   46 */   private SimpleDateFormat sdfNet = new SimpleDateFormat("yyyy-MM-dd");
/*   47 */   private Connection con = null;
/*   48 */   private Statement stmt = null;
/*   49 */   ResultSet rs = null;
/*      */ 
/*      */   public ImportDAO() {
/*      */     try {
/*   53 */       dbcoInit();
/*      */     }
/*      */     catch (Exception e) {
/*   56 */       e.printStackTrace();
/*      */     }
/*      */   }
/*      */ 
/*      */   private void dbcoInit() throws Exception {
/*      */     try {
/*   62 */       Class.forName("org.logicalcobwebs.proxool.ProxoolDriver");
/*   63 */       this.con = DriverManager.getConnection("proxool.dbpool");
/*   64 */       this.stmt = this.con.createStatement(1005, 1008);
/*      */     } catch (SQLException ex) {
/*   66 */       System.err.println("init fail: " + ex.getMessage());
/*      */     }
/*      */   }
/*      */ 
/*      */   public ResultSet execQuery(String sql) throws Exception
/*      */   {
/*      */     try {
/*   73 */       if (this.con == null) {
/*   74 */         dbcoInit();
/*      */       }
/*   76 */       return this.rs = this.stmt.executeQuery(sql);
/*      */     } catch (SQLException e) {
/*   78 */       throw e;
/*      */     }
/*      */   }
/*      */ 
/*      */   public int[] executeBatch(List list) throws Exception {
/*      */     try {
/*   84 */       if (this.con == null) {
/*   85 */         dbcoInit();
/*      */       }
/*   87 */       if ((list == null) || (list.size() < 1))
/*   88 */         return null;
/*   89 */       for (int i = 0; i < list.size(); i++)
/*   90 */         this.stmt.addBatch(list.get(i).toString());
/*   91 */       return this.stmt.executeBatch();
/*      */     } catch (SQLException e) {
/*   93 */       throw e;
/*      */     }
/*      */   }
/*      */ 
/*      */   public void closeAll() {
/*      */     try {
/*   99 */       if (this.rs != null) {
/*  100 */         this.rs.close();
/*      */       }
/*  102 */       this.rs = null;
/*      */ 
/*  104 */       if (this.stmt != null) {
/*  105 */         this.stmt.close();
/*      */       }
/*  107 */       this.stmt = null;
/*  108 */       if (this.con != null) {
/*  109 */         this.con.close();
/*      */       }
/*  111 */       this.con = null;
/*      */     } catch (SQLException e) {
/*  113 */       e.printStackTrace();
/*      */     }
/*      */   }
/*      */ 
/*      */   public boolean importBtsNewData(List list)
/*      */   {
/*  119 */     log.info("批量导入--BTS---开始");
/*  120 */     boolean flag = true;
/*      */     try
/*      */     {
/*  124 */       if ((list == null) || (list.size() < 1)) {
/*  125 */         throw new Exception("excel 没有【无线设备】数据");
/*      */       }
/*  127 */       int countNum = list.size();
/*  128 */       List sqlList = new ArrayList();
/*  129 */       StringBuffer sqlBuf = new StringBuffer();
/*  130 */       sqlList.add(" delete from bts_new ");
/*  131 */       sqlBuf.append(" insert into bts_new (btsname,frequency, btscode, BSC, manufacturer, cabinet, primdevicetype, ");
/*  132 */       sqlBuf.append("btscfg, frequencyNum, combinerType, combinerNum, primContrmodel, primContrNum, ");
/*  133 */       sqlBuf.append("powerPanelType, powerPanelNum, powerType, ele2Mnum, registtime, antennaType, ");
/*  134 */       sqlBuf.append("antennaFac, antennaNum, antennaGain, antennaDirect, antennaPolar, antennaHeight,");
/*  135 */       sqlBuf.append("antennaPre, antennaAngle, antennaPitchAngle, feederType, other1, other2, ");
/*  136 */       sqlBuf.append("other3, other4, IDUType, IDUNum, ODUType, ODUNum, refreshtime, memo ) values ");
/*  137 */       for (int i = 0; i < countNum; i++)
/*      */       {
/*  140 */         BTSNewBO bo = (BTSNewBO)list.get(i);
/*  141 */         sqlBuf.append(" ( ");
/*  142 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/*  143 */         sqlBuf.append(" '" + bo.getFrequency() + "' ,");
/*  144 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/*  145 */         sqlBuf.append(" '" + bo.getBSC() + "' ,");
/*  146 */         sqlBuf.append(" '" + bo.getManufacturer() + "' ,");
/*  147 */         sqlBuf.append(" '" + bo.getCabinet() + "' ,");
/*  148 */         sqlBuf.append(" '" + bo.getPrimdevicetype() + "' ,");
/*  149 */         sqlBuf.append(" '" + bo.getBtscfg() + "' ,");
/*  150 */         sqlBuf.append(" '" + bo.getFrequencyNum() + "' ,");
/*  151 */         sqlBuf.append(" '" + bo.getCombinerType() + "' ,");
/*  152 */         sqlBuf.append(" '" + bo.getCombinerNum() + "' ,");
/*  153 */         sqlBuf.append(" '" + bo.getPrimContrmodel() + "' ,");
/*  154 */         sqlBuf.append(" '" + bo.getPrimContrNum() + "' ,");
/*  155 */         sqlBuf.append(" '" + bo.getPowerPanelType() + "' ,");
/*  156 */         sqlBuf.append(" '" + bo.getPowerPanelNum() + "' ,");
/*  157 */         sqlBuf.append(" '" + bo.getPowerType() + "' ,");
/*  158 */         sqlBuf.append(" '" + bo.getEle2Mnum() + "' ,");
/*  159 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getRegisttime()) + "' ,");
/*  160 */         sqlBuf.append(" '" + bo.getAntennaType() + "' ,");
/*  161 */         sqlBuf.append(" '" + bo.getAntennaFac() + "' ,");
/*  162 */         sqlBuf.append(" '" + bo.getAntennaNum() + "' ,");
/*  163 */         sqlBuf.append(" '" + bo.getAntennaGain() + "' ,");
/*  164 */         sqlBuf.append(" '" + bo.getAntennaDirect() + "' ,");
/*  165 */         sqlBuf.append(" '" + bo.getAntennaPolar() + "' ,");
/*  166 */         sqlBuf.append(" '" + bo.getAntennaHeight() + "' ,");
/*  167 */         sqlBuf.append(" '" + bo.getAntennaPre() + "' ,");
/*  168 */         sqlBuf.append(" '" + bo.getAntennaAngle() + "' ,");
/*  169 */         sqlBuf.append(" '" + bo.getAntennaPitchAngle() + "' ,");
/*  170 */         sqlBuf.append(" '" + bo.getFeederType() + "' ,");
/*  171 */         sqlBuf.append(" '" + bo.getOther1() + "' ,");
/*  172 */         sqlBuf.append(" '" + bo.getOther2() + "' ,");
/*  173 */         sqlBuf.append(" '" + bo.getOther3() + "' ,");
/*  174 */         sqlBuf.append(" '" + bo.getOther4() + "' ,");
/*  175 */         sqlBuf.append(" '" + bo.getIDUType() + "' ,");
/*  176 */         sqlBuf.append(" '" + bo.getIDUNum() + "' ,");
/*  177 */         sqlBuf.append(" '" + bo.getODUType() + "' ,");
/*  178 */         sqlBuf.append(" '" + bo.getODUNum() + "' ,");
/*  179 */         sqlBuf.append(" '" + this.sdfNet.format(new Date()) + "' ,");
/*  180 */         if (i == countNum - 1)
/*  181 */           sqlBuf.append(" '" + bo.getMemo() + "' );");
/*      */         else {
/*  183 */           sqlBuf.append(" '" + bo.getMemo() + "' ),");
/*      */         }
/*      */       }
/*      */ 
/*  187 */       String strSQL = sqlBuf.toString();
/*  188 */       sqlList.add(strSQL);
/*  189 */       log.info(strSQL);
/*  190 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/*  194 */       flag = false;
/*  195 */       e.printStackTrace();
/*  196 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/*  199 */       closeAll();
/*      */     }
/*  201 */     log.info("批量导入--BTS---结束");
/*  202 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importMagnifierData(List list)
/*      */   {
/*  208 */     log.info("批量导入--塔放---开始");
/*  209 */     log.info(list);
/*  210 */     boolean flag = true;
/*      */     try
/*      */     {
/*  213 */       if ((list == null) || (list.size() < 1)) {
/*  214 */         throw new Exception("excel 没有【塔放】数据");
/*      */       }
/*  216 */       int countNum = list.size();
/*  217 */       List sqlList = new ArrayList();
/*  218 */       sqlList.add(" delete from magnifier ");
/*  219 */       StringBuffer sqlBuf = new StringBuffer();
/*  220 */       sqlBuf.append(" insert into magnifier ( btscode,btsname, type, capacity, manufacturer, num,");
/*  221 */       sqlBuf.append("  cellU, opentime, maintenance, refreshtime,registtime, memo) values  ");
/*  222 */       for (int i = 0; i < countNum; i++)
/*      */       {
/*  224 */         MagnifierBO bo = (MagnifierBO)list.get(i);
/*  225 */         sqlBuf.append(" ( ");
/*  226 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/*  227 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/*  228 */         sqlBuf.append(" '" + bo.getType() + "' ,");
/*  229 */         sqlBuf.append(" '" + bo.getCapacity() + "' ,");
/*  230 */         sqlBuf.append(" '" + bo.getManufacturer() + "' ,");
/*  231 */         sqlBuf.append(" '" + bo.getNum() + "' ,");
/*  232 */         sqlBuf.append(" '" + bo.getCellU() + "' ,");
/*  233 */         sqlBuf.append(" '" + this.sdf.format(bo.getOpentime()) + "' ,");
/*  234 */         sqlBuf.append(" '" + bo.getMaintenance() + "' ,");
/*  235 */         sqlBuf.append(" '" + this.sdf.format(new Date()) + "' ,");
/*  236 */         sqlBuf.append(" '" + this.sdfNet.format(new Date()) + "' ,");
/*  237 */         if (i == countNum - 1)
/*  238 */           sqlBuf.append(" '" + bo.getMemo() + "' );");
/*      */         else
/*  240 */           sqlBuf.append(" '" + bo.getMemo() + "' ),");
/*      */       }
/*  242 */       String strSQL = sqlBuf.toString();
/*  243 */       sqlList.add(strSQL);
/*  244 */       log.info(strSQL);
/*  245 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/*  249 */       flag = false;
/*  250 */       e.printStackTrace();
/*  251 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/*  254 */       closeAll();
/*      */     }
/*  256 */     log.info("批量导入--塔放---结束");
/*  257 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean imporPowerBoxData(List list)
/*      */   {
/*  262 */     log.info("批量导入--电源柜---开始");
/*  263 */     boolean flag = true;
/*      */     try
/*      */     {
/*  266 */       if ((list == null) || (list.size() < 1)) {
/*  267 */         throw new Exception("excel 没有【电源柜】数据");
/*      */       }
/*  269 */       List sqlList = new ArrayList();
/*  270 */       sqlList.add(" delete from powerbox ");
/*      */ 
/*  272 */       StringBuffer sqlBuf = new StringBuffer();
/*  273 */       sqlBuf.append(" insert into powerbox (btscode, btsname, type, manufacturer, num, dcvoltage,");
/*  274 */       sqlBuf.append(" registtime, commtype, commcapacity, monmodel, monnum, maintenance, refreshtime,");
/*  275 */       sqlBuf.append(" memo, pboxOutI, pboxNum, pboxWorkSta) values  ");
/*  276 */       int countNum = list.size();
/*  277 */       for (int i = 0; i < countNum; i++)
/*      */       {
/*  279 */         PowerBoxBO bo = (PowerBoxBO)list.get(i);
/*  280 */         sqlBuf.append(" ( ");
/*  281 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/*  282 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/*  283 */         sqlBuf.append(" '" + bo.getType() + "' ,");
/*  284 */         sqlBuf.append(" '" + bo.getManufacturer() + "' ,");
/*  285 */         sqlBuf.append(" '" + bo.getNum() + "' ,");
/*  286 */         sqlBuf.append(" '" + bo.getDcvoltage() + "' ,");
/*  287 */         sqlBuf.append(" '" + this.sdf.format(bo.getOpentime()) + "' ,");
/*  288 */         sqlBuf.append(" '" + bo.getCommtype() + "' ,");
/*  289 */         sqlBuf.append(" '" + bo.getCommcapacity() + "' ,");
/*  290 */         sqlBuf.append(" '" + bo.getMonmodel() + "' ,");
/*  291 */         sqlBuf.append(" '" + bo.getMonnum() + "' ,");
/*  292 */         sqlBuf.append(" '" + bo.getMaintenance() + "' ,");
/*  293 */         sqlBuf.append(" '" + this.sdf.format(new Date()) + "' ,");
/*  294 */         sqlBuf.append(" '" + bo.getMemo() + "' ,");
/*  295 */         sqlBuf.append(" '" + bo.getPboxOutI() + "' ,");
/*  296 */         sqlBuf.append(" '" + bo.getPboxNum() + "' ,");
/*  297 */         if (i == countNum - 1)
/*  298 */           sqlBuf.append(" '" + bo.getPboxWorkSta() + "' );");
/*      */         else
/*  300 */           sqlBuf.append(" '" + bo.getPboxWorkSta() + "' ),");
/*      */       }
/*  302 */       String strSQL = sqlBuf.toString();
/*  303 */       sqlList.add(strSQL);
/*  304 */       log.info(strSQL);
/*  305 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/*  309 */       flag = false;
/*  310 */       e.printStackTrace();
/*  311 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/*  314 */       closeAll();
/*      */     }
/*  316 */     log.info("批量导入--电源柜---结束");
/*  317 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean imporStorageBatteryData(List list)
/*      */   {
/*  322 */     log.info("批量导入--蓄电池---开始");
/*  323 */     boolean flag = true;
/*      */     try
/*      */     {
/*  326 */       if ((list == null) || (list.size() < 1)) {
/*  327 */         throw new Exception("excel 没有【蓄电池】数据");
/*      */       }
/*  329 */       List sqlList = new ArrayList();
/*  330 */       sqlList.add(" delete from storagebattery ");
/*      */ 
/*  332 */       StringBuffer sqlBuf = new StringBuffer();
/*  333 */       sqlBuf.append(" insert into storagebattery (  btscode,no,switchNo, btsname, type, manufacturer, capacity, groupnum,");
/*  334 */       sqlBuf.append(" batterynum,  voltage, registtime, discharge, maintenance, refreshtime,  memo ) values  ");
/*  335 */       int countNum = list.size();
/*  336 */       for (int i = 0; i < countNum; i++)
/*      */       {
/*  338 */         StoragebatteryBO bo = (StoragebatteryBO)list.get(i);
/*  339 */         sqlBuf.append(" ( ");
/*  340 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/*  341 */         sqlBuf.append(" '" + bo.getNo() + "' ,");
/*  342 */         sqlBuf.append(" '" + bo.getSwitchNo() + "' ,");
/*  343 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/*  344 */         sqlBuf.append(" '" + bo.getType() + "' ,");
/*  345 */         sqlBuf.append(" '" + bo.getManufacturer() + "' ,");
/*  346 */         sqlBuf.append(" '" + bo.getCapacity() + "' ,");
/*  347 */         sqlBuf.append(" '" + bo.getGroupnum() + "' ,");
/*  348 */         sqlBuf.append(" '" + bo.getBatterynum() + "' ,");
/*  349 */         sqlBuf.append(" '" + bo.getVoltage() + "' ,");
/*  350 */         sqlBuf.append(" '" + this.sdf.format(bo.getOpentime()) + "' ,");
/*  351 */         sqlBuf.append(" '" + bo.getDischarge() + "' ,");
/*  352 */         sqlBuf.append(" '" + bo.getMaintenance() + "' ,");
/*  353 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getRefreshtime()) + "' ,");
/*  354 */         if (i == countNum - 1)
/*  355 */           sqlBuf.append(" '" + bo.getMemo() + "' );");
/*      */         else
/*  357 */           sqlBuf.append(" '" + bo.getMemo() + "' ),");
/*      */       }
/*  359 */       String strSQL = sqlBuf.toString();
/*  360 */       sqlList.add(strSQL);
/*  361 */       log.info(strSQL);
/*  362 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/*  366 */       flag = false;
/*  367 */       e.printStackTrace();
/*  368 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/*  371 */       closeAll();
/*      */     }
/*  373 */     log.info("批量导入--蓄电池---结束");
/*  374 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean imporAirconditionData(List list)
/*      */   {
/*  379 */     log.info("批量导入--空调---开始");
/*  380 */     boolean flag = true;
/*      */     try
/*      */     {
/*  383 */       if ((list == null) || (list.size() < 1)) {
/*  384 */         throw new Exception("excel 没有【空调】数据");
/*      */       }
/*  386 */       List sqlList = new ArrayList();
/*  387 */       sqlList.add(" delete from aircondition ");
/*      */ 
/*  389 */       StringBuffer sqlBuf = new StringBuffer();
/*  390 */       sqlBuf.append(" insert into aircondition ( btscode, btsname, type, manufacturer, capacity,");
/*  391 */       sqlBuf.append(" num, registtime, fence, maintenance, refreshtime, memo, aircPowerType,");
/*  392 */       sqlBuf.append(" aircType, aircInSideSize, aircOutSideSize ) values  ");
/*      */ 
/*  394 */       int countNum = list.size();
/*  395 */       for (int i = 0; i < countNum; i++)
/*      */       {
/*  397 */         AirconditionBO bo = (AirconditionBO)list.get(i);
/*  398 */         sqlBuf.append(" ( ");
/*  399 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/*  400 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/*  401 */         sqlBuf.append(" '" + bo.getType() + "' ,");
/*  402 */         sqlBuf.append(" '" + bo.getManufacturer() + "' ,");
/*  403 */         sqlBuf.append(" '" + bo.getCapacity() + "' ,");
/*  404 */         sqlBuf.append(" '" + bo.getNum() + "' ,");
/*  405 */         sqlBuf.append(" '" + this.sdf.format(bo.getOpentime()) + "' ,");
/*  406 */         sqlBuf.append(" '" + bo.getFence() + "' ,");
/*  407 */         sqlBuf.append(" '" + bo.getMaintenance() + "' ,");
/*  408 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getRefreshtime()) + "' ,");
/*  409 */         sqlBuf.append(" '" + bo.getMemo() + "' ,");
/*  410 */         sqlBuf.append(" '" + bo.getAircPowerType() + "' ,");
/*  411 */         sqlBuf.append(" '" + bo.getAircType() + "' ,");
/*  412 */         sqlBuf.append(" '" + bo.getAircInSideSize() + "' ,");
/*  413 */         if (i == countNum - 1)
/*  414 */           sqlBuf.append(" '" + bo.getAircOutSideSize() + "' );");
/*      */         else
/*  416 */           sqlBuf.append(" '" + bo.getAircOutSideSize() + "' ),");
/*      */       }
/*  418 */       String strSQL = sqlBuf.toString();
/*  419 */       sqlList.add(strSQL);
/*  420 */       log.info(strSQL);
/*  421 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/*  425 */       flag = false;
/*  426 */       e.printStackTrace();
/*  427 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/*  430 */       closeAll();
/*      */     }
/*  432 */     log.info("批量导入--空调---结束");
/*  433 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importFireExtinGuisherData(List list) {
/*  437 */     log.info("批量导入--灭火器---结束");
/*  438 */     boolean flag = true;
/*      */     try
/*      */     {
/*  442 */       if ((list == null) || (list.size() < 1)) {
/*  443 */         throw new Exception("excel 没有【灭火器】数据");
/*      */       }
/*  445 */       List sqlList = new ArrayList();
/*  446 */       sqlList.add(" delete from fireextinguisher ");
/*      */ 
/*  448 */       StringBuffer sqlBuf = new StringBuffer();
/*  449 */       sqlBuf.append(" insert into fireextinguisher ( btscode, btsname, manufacturer,");
/*  450 */       sqlBuf.append(" type, num, inwarranty, maintenance, refreshtime, memo, fireeType, registtime,fireeIsEff ) values  ");
/*  451 */       int countNum = list.size();
/*  452 */       for (int i = 0; i < countNum; i++)
/*      */       {
/*  454 */         sqlBuf.append(" ( ");
/*  455 */         FireExtinGuisherBO bo = (FireExtinGuisherBO)list.get(i);
/*      */ 
/*  457 */         sqlBuf.append(" '" + bo.getBtscode() + "', ");
/*  458 */         sqlBuf.append(" '" + bo.getBtsname() + "', ");
/*  459 */         sqlBuf.append(" '" + bo.getManufacturer() + "', ");
/*  460 */         sqlBuf.append(" '" + bo.getType() + "', ");
/*  461 */         sqlBuf.append(" '" + bo.getNum() + "', ");
/*  462 */         sqlBuf.append(" '" + bo.getInwarranty() + "', ");
/*  463 */         sqlBuf.append(" '" + bo.getMaintenance() + "', ");
/*  464 */         sqlBuf.append(" '" + this.sdf.format(bo.getRefreshtime()) + "', ");
/*  465 */         sqlBuf.append(" '" + bo.getMemo() + "', ");
/*  466 */         sqlBuf.append(" '" + bo.getFireeType() + "', ");
/*  467 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getRegisttime()) + "', ");
/*  468 */         if (i == countNum - 1)
/*  469 */           sqlBuf.append(" '" + bo.getFireeIsEff() + "' ); ");
/*      */         else
/*  471 */           sqlBuf.append(" '" + bo.getFireeIsEff() + "' ), ");
/*      */       }
/*  473 */       String strSQL = sqlBuf.toString();
/*  474 */       sqlList.add(strSQL);
/*  475 */       log.info(strSQL);
/*  476 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/*  480 */       flag = false;
/*  481 */       e.printStackTrace();
/*  482 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/*  485 */       closeAll();
/*      */     }
/*  487 */     log.info("批量导入--灭火器---结束");
/*  488 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importBathunderData(List list) {
/*  492 */     log.info("批量导入--B级防雷器---开始");
/*  493 */     boolean flag = true;
/*      */     try
/*      */     {
/*  496 */       if ((list == null) || (list.size() < 1)) {
/*  497 */         throw new Exception("excel 没有【B级防雷器】数据");
/*      */       }
/*  499 */       List sqlList = new ArrayList();
/*  500 */       sqlList.add(" delete from bathunder ");
/*      */ 
/*  502 */       StringBuffer sqlBuf = new StringBuffer();
/*  503 */       sqlBuf.append(" insert into bathunder ( btscode,btsname,type,manufacturer,capacity, ");
/*  504 */       sqlBuf.append(" num, registtime,maintenance,refreshtime,memo,hunderPowerType, ");
/*  505 */       sqlBuf.append(" hunderWorkSta, hunderLineLen ) values  ");
/*  506 */       int countNum = list.size();
/*  507 */       for (int i = 0; i < countNum; i++)
/*      */       {
/*  509 */         sqlBuf.append(" ( ");
/*  510 */         BathunderBO bo = (BathunderBO)list.get(i);
/*  511 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/*  512 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/*  513 */         sqlBuf.append(" '" + bo.getType() + "' ,");
/*  514 */         sqlBuf.append(" '" + bo.getManufacturer() + "' ,");
/*  515 */         sqlBuf.append(" '" + bo.getCapacity() + "' ,");
/*  516 */         sqlBuf.append(" '" + bo.getNum() + "' ,");
/*  517 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getOpentime()) + "' ,");
/*  518 */         sqlBuf.append(" '" + bo.getMaintenance() + "' ,");
/*  519 */         sqlBuf.append(" '" + this.sdf.format(bo.getRefreshtime()) + "' ,");
/*  520 */         sqlBuf.append(" '" + bo.getMemo() + "' ,");
/*  521 */         sqlBuf.append(" '" + bo.getHunderPowerType() + "' ,");
/*  522 */         sqlBuf.append(" '" + bo.getHunderWorkSta() + "' ,");
/*      */ 
/*  524 */         if (i == countNum - 1)
/*  525 */           sqlBuf.append(" '" + bo.getHunderLineLen() + "' );");
/*      */         else
/*  527 */           sqlBuf.append(" '" + bo.getHunderLineLen() + "' ),");
/*      */       }
/*  529 */       String strSQL = sqlBuf.toString();
/*  530 */       sqlList.add(strSQL);
/*  531 */       log.info(strSQL);
/*  532 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/*  536 */       flag = false;
/*  537 */       e.printStackTrace();
/*  538 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/*  541 */       closeAll();
/*      */     }
/*  543 */     log.info("批量导入--B级防雷器---结束");
/*  544 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importEnvMontorData(List list) {
/*  548 */     log.info("批量导入--动环监控---开始");
/*  549 */     boolean flag = true;
/*      */     try
/*      */     {
/*  552 */       if ((list == null) || (list.size() < 1)) {
/*  553 */         throw new Exception("excel 没有【动环监控】数据");
/*      */       }
/*  555 */       List sqlList = new ArrayList();
/*  556 */       sqlList.add(" delete from envmontor ");
/*      */ 
/*  558 */       StringBuffer sqlBuf = new StringBuffer();
/*  559 */       sqlBuf.append(" insert into envmontor (btscode, btsname, type, manufacturer,");
/*  560 */       sqlBuf.append(" monobj, transType, transPort, registtime, maintenance,");
/*  561 */       sqlBuf.append(" refreshtime, memo, monWorkSta ) values  ");
/*      */ 
/*  563 */       int countNum = list.size();
/*  564 */       for (int i = 0; i < countNum; i++)
/*      */       {
/*  566 */         sqlBuf.append(" ( ");
/*      */ 
/*  568 */         EnvMontorBO bo = (EnvMontorBO)list.get(i);
/*  569 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/*  570 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/*  571 */         sqlBuf.append(" '" + bo.getType() + "' ,");
/*  572 */         sqlBuf.append(" '" + bo.getManufacturer() + "' ,");
/*  573 */         sqlBuf.append(" '" + bo.getMonobj() + "' ,");
/*  574 */         sqlBuf.append(" '" + bo.getTransType() + "' ,");
/*  575 */         sqlBuf.append(" '" + bo.getTransPort() + "' ,");
/*  576 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getOpentime()) + "' ,");
/*  577 */         sqlBuf.append(" '" + bo.getMaintenance() + "' ,");
/*  578 */         sqlBuf.append(" '" + this.sdf.format(bo.getRefreshtime()) + "' ,");
/*  579 */         sqlBuf.append(" '" + bo.getMemo() + "' ,");
/*  580 */         if (i == countNum - 1)
/*  581 */           sqlBuf.append(" '" + bo.getMonWorkSta() + "' );");
/*      */         else
/*  583 */           sqlBuf.append(" '" + bo.getMonWorkSta() + "' ),");
/*      */       }
/*  585 */       String strSQL = sqlBuf.toString();
/*  586 */       sqlList.add(strSQL);
/*  587 */       log.info(strSQL);
/*  588 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/*  592 */       flag = false;
/*  593 */       e.printStackTrace();
/*  594 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/*  597 */       closeAll();
/*      */     }
/*  599 */     log.info("批量导入--动环监控---结束");
/*  600 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importDynamoData(List list) {
/*  604 */     log.info("批量导入--发电机组---开始");
/*  605 */     boolean flag = true;
/*      */     try
/*      */     {
/*  608 */       if ((list == null) || (list.size() < 1)) {
/*  609 */         throw new Exception("excel 没有【发电机组】数据");
/*      */       }
/*  611 */       List sqlList = new ArrayList();
/*  612 */       sqlList.add(" delete from dynamo ");
/*      */ 
/*  614 */       StringBuffer sqlBuf = new StringBuffer();
/*  615 */       sqlBuf.append(" insert into dynamo ( btscode, btsname, manufacturer,  type, model, ");
/*  616 */       sqlBuf.append(" power, autoboot,  consumption, sumtime,  maintenance, refreshtime,");
/*  617 */       sqlBuf.append(" memo, dynamoIsStatic, danymoSeiral, dynamoWorkLen, dynamoMaintainRec,registtime,dynamoHouse ) values  ");
/*      */ 
/*  619 */       int countNum = list.size();
/*  620 */       for (int i = 0; i < countNum; i++)
/*      */       {
/*  622 */         sqlBuf.append(" ( ");
/*      */ 
/*  624 */         DynamoBO bo = (DynamoBO)list.get(i);
/*  625 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/*  626 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/*  627 */         sqlBuf.append(" '" + bo.getManufacturer() + "' ,");
/*  628 */         sqlBuf.append(" '" + bo.getType() + "' ,");
/*  629 */         sqlBuf.append(" '" + bo.getModel() + "' ,");
/*  630 */         sqlBuf.append(" '" + bo.getPower() + "' ,");
/*  631 */         sqlBuf.append(" '" + bo.getAutoboot() + "' ,");
/*  632 */         sqlBuf.append(" '" + bo.getConsumption() + "' ,");
/*  633 */         sqlBuf.append(" '" + bo.getSumtime() + "' ,");
/*  634 */         sqlBuf.append(" '" + bo.getMaintenance() + "' ,");
/*  635 */         sqlBuf.append(" '" + this.sdf.format(bo.getRefreshtime()) + "' ,");
/*  636 */         sqlBuf.append(" '" + bo.getMemo() + "' ,");
/*  637 */         sqlBuf.append(" '" + bo.getDynamoIsStatic() + "' ,");
/*  638 */         sqlBuf.append(" '" + bo.getDanymoSeiral() + "' ,");
/*  639 */         sqlBuf.append(" '" + bo.getDynamoWorkLen() + "' ,");
/*  640 */         sqlBuf.append(" '" + bo.getDynamoMaintainRec() + "' ,");
/*  641 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getRegisttime()) + "' ,");
/*  642 */         if (i == countNum - 1)
/*  643 */           sqlBuf.append(" '" + bo.getDynamoHouse() + "' );");
/*      */         else
/*  645 */           sqlBuf.append(" '" + bo.getDynamoHouse() + "' ),");
/*      */       }
/*  647 */       String strSQL = sqlBuf.toString();
/*  648 */       sqlList.add(strSQL);
/*  649 */       log.info(strSQL);
/*  650 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e) {
/*  653 */       flag = false;
/*  654 */       e.printStackTrace();
/*  655 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/*  658 */       closeAll();
/*      */     }
/*  660 */     log.info("批量导入--发电机组---结束");
/*  661 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importAcdcDistributionData(List list) {
/*  665 */     log.info("批量导入--交直流配电---开始");
/*  666 */     boolean flag = true;
/*      */     try
/*      */     {
/*  669 */       if ((list == null) || (list.size() < 1)) {
/*  670 */         throw new Exception("excel 没有【发电机组】数据");
/*      */       }
/*  672 */       List sqlList = new ArrayList();
/*  673 */       sqlList.add(" delete from acdcdistribution ");
/*      */ 
/*  675 */       StringBuffer sqlBuf = new StringBuffer();
/*  676 */       sqlBuf.append(" insert into acdcdistribution ( btscode, btsname,  distmanufacturer,  disttype,");
/*  677 */       sqlBuf.append(" distother,  airswitchM, airswitchT, airswitchC,  airswitchO, airswitchCRD,");
/*  678 */       sqlBuf.append(" elecableDAS,  elecableDAT, elecableDANum, elecableDALen, elecableDACRD,");
/*  679 */       sqlBuf.append(" regulatorM,  regulatorT, regulatorC,regulatorOT , regulatorCRD, lighting,");
/*  680 */       sqlBuf.append(" socket, elecableCPS, elecableCPT, elecableCPNum, elecableCPLen, elecableCPCRD,");
/*  681 */       sqlBuf.append(" DDConverterT, DDConverterM, DDConverterNum, DDConverterC, DDConverterOT,");
/*  682 */       sqlBuf.append(" DDConverterCRD, DDisplayT, DDisplayM,  DDisplayNum, DDisplayC,  DDisplayOT,");
/*  683 */       sqlBuf.append(" maintenance, refreshtime, registtime, memo ) values  ");
/*      */ 
/*  685 */       int countNum = list.size();
/*  686 */       for (int i = 0; i < countNum; i++)
/*      */       {
/*  688 */         sqlBuf.append(" ( ");
/*      */ 
/*  690 */         AcdcDistributionBO bo = (AcdcDistributionBO)list.get(i);
/*  691 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/*  692 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/*  693 */         sqlBuf.append(" '" + bo.getDistmanufacturer() + "' ,");
/*  694 */         sqlBuf.append(" '" + bo.getDisttype() + "' ,");
/*  695 */         sqlBuf.append(" '" + bo.getDistother() + "' ,");
/*  696 */         sqlBuf.append(" '" + bo.getAirswitchM() + "' ,");
/*  697 */         sqlBuf.append(" '" + bo.getAirswitchT() + "' ,");
/*  698 */         sqlBuf.append(" '" + bo.getAirswitchC() + "' ,");
/*  699 */         sqlBuf.append(" '" + bo.getAirswitchO() + "' ,");
/*  700 */         sqlBuf.append(" '" + bo.getAirswitchCRD() + "' ,");
/*  701 */         sqlBuf.append(" '" + bo.getElecableDAS() + "' ,");
/*  702 */         sqlBuf.append(" '" + bo.getElecableDAT() + "' ,");
/*  703 */         sqlBuf.append(" '" + bo.getElecableDANum() + "' ,");
/*      */ 
/*  705 */         sqlBuf.append(" '" + bo.getElecableDALen() + "' ,");
/*  706 */         sqlBuf.append(" '" + bo.getElecableDACRD() + "' ,");
/*  707 */         sqlBuf.append(" '" + bo.getRegulatorM() + "' ,");
/*  708 */         sqlBuf.append(" '" + bo.getRegulatorT() + "' ,");
/*  709 */         sqlBuf.append(" '" + bo.getRegulatorC() + "' ,");
/*  710 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getRegulatorOT()) + "' ,");
/*  711 */         sqlBuf.append(" '" + bo.getRegulatorCRD() + "' ,");
/*  712 */         sqlBuf.append(" '" + bo.getLighting() + "' ,");
/*  713 */         sqlBuf.append(" '" + bo.getSocket() + "' ,");
/*  714 */         sqlBuf.append(" '" + bo.getElecableCPS() + "' ,");
/*  715 */         sqlBuf.append(" '" + bo.getElecableCPT() + "' ,");
/*  716 */         sqlBuf.append(" '" + bo.getElecableCPNum() + "' ,");
/*  717 */         sqlBuf.append(" '" + bo.getElecableCPLen() + "' ,");
/*  718 */         sqlBuf.append(" '" + bo.getElecableCPCRD() + "' ,");
/*  719 */         sqlBuf.append(" '" + bo.getDDConverterT() + "' ,");
/*  720 */         sqlBuf.append(" '" + bo.getDDConverterM() + "' ,");
/*  721 */         sqlBuf.append(" '" + bo.getDDConverterNum() + "' ,");
/*  722 */         sqlBuf.append(" '" + bo.getDDConverterC() + "' ,");
/*  723 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getDDConverterOT()) + "' ,");
/*  724 */         sqlBuf.append(" '" + bo.getDDConverterCRD() + "' ,");
/*  725 */         sqlBuf.append(" '" + bo.getDDisplayT() + "' ,");
/*  726 */         sqlBuf.append(" '" + bo.getDDisplayM() + "' ,");
/*  727 */         sqlBuf.append(" '" + bo.getDDisplayNum() + "' ,");
/*  728 */         sqlBuf.append(" '" + bo.getDDisplayC() + "' ,");
/*  729 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getDDisplayOT()) + "' ,");
/*  730 */         sqlBuf.append(" '" + bo.getMaintenance() + "' ,");
/*  731 */         sqlBuf.append(" '" + this.sdf.format(bo.getRefreshtime()) + "' ,");
/*  732 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getRegulatorOT()) + "' ,");
/*  733 */         if (i == countNum - 1)
/*  734 */           sqlBuf.append(" '" + bo.getMemo() + "' );");
/*      */         else
/*  736 */           sqlBuf.append(" '" + bo.getMemo() + "' ),");
/*      */       }
/*  738 */       String strSQL = sqlBuf.toString();
/*  739 */       sqlList.add(strSQL);
/*  740 */       log.info(strSQL);
/*  741 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/*  745 */       flag = false;
/*  746 */       e.printStackTrace();
/*  747 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/*  750 */       closeAll();
/*      */     }
/*  752 */     log.info("批量导入--交直流配电---结束");
/*  753 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importTransformerData(List list) {
/*  757 */     log.info("批量导入--变压器---开始");
/*  758 */     boolean flag = true;
/*      */     try
/*      */     {
/*  761 */       if ((list == null) || (list.size() < 1)) {
/*  762 */         throw new Exception("excel 没有【变压器】数据");
/*      */       }
/*  764 */       List sqlList = new ArrayList();
/*  765 */       sqlList.add(" delete from transformer ");
/*      */ 
/*  767 */       StringBuffer sqlBuf = new StringBuffer();
/*  768 */       sqlBuf.append(" insert into transformer ( btscode, btsname, model,  capacity,");
/*  769 */       sqlBuf.append(" manufacturer, property, maintenance, refreshtime,  memo,");
/*  770 */       sqlBuf.append(" tranPowerType, tranMaintain, tranHighLen, tranLowLen,");
/*  771 */       sqlBuf.append(" tranRValue, registtime,tranStartTime  ) values  ");
/*      */ 
/*  773 */       int countNum = list.size();
/*  774 */       for (int i = 0; i < countNum; i++)
/*      */       {
/*  776 */         sqlBuf.append(" ( ");
/*      */ 
/*  778 */         TransformerBO bo = (TransformerBO)list.get(i);
/*  779 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/*  780 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/*  781 */         sqlBuf.append(" '" + bo.getModel() + "' ,");
/*  782 */         sqlBuf.append(" '" + bo.getCapacity() + "' ,");
/*  783 */         sqlBuf.append(" '" + bo.getManufacturer() + "' ,");
/*  784 */         sqlBuf.append(" '" + bo.getProperty() + "' ,");
/*  785 */         sqlBuf.append(" '" + bo.getMaintenance() + "' ,");
/*  786 */         sqlBuf.append(" '" + this.sdf.format(bo.getRefreshtime()) + "' ,");
/*  787 */         sqlBuf.append(" '" + bo.getMemo() + "' , ");
/*  788 */         sqlBuf.append(" '" + bo.getTranPowerType() + "' ,");
/*  789 */         sqlBuf.append(" '" + bo.getTranMaintain() + "' ,");
/*  790 */         sqlBuf.append(" '" + bo.getTranHighLen() + "' ,");
/*  791 */         sqlBuf.append(" '" + bo.getTranLowLen() + "' ,");
/*  792 */         sqlBuf.append(" '" + bo.getTranRValue() + "' ,");
/*  793 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getRegisttime()) + "' ,");
/*  794 */         if (i == countNum - 1)
/*  795 */           sqlBuf.append(" '" + bo.getTranStartTime() + "' );");
/*      */         else
/*  797 */           sqlBuf.append(" '" + bo.getTranStartTime() + "' ),");
/*      */       }
/*  799 */       String strSQL = sqlBuf.toString();
/*  800 */       sqlList.add(strSQL);
/*  801 */       log.info(strSQL);
/*  802 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/*  806 */       flag = false;
/*  807 */       e.printStackTrace();
/*  808 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/*  811 */       closeAll();
/*      */     }
/*  813 */     log.info("批量导入--变压器---结束");
/*  814 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importForTransfersData(List list) {
/*  818 */     log.info("批量导入--传输---开始");
/*  819 */     boolean flag = true;
/*      */     try
/*      */     {
/*  823 */       if ((list == null) || (list.size() < 1)) {
/*  824 */         throw new Exception("excel 没有【传输】数据");
/*      */       }
/*  826 */       List sqlList = new ArrayList();
/*  827 */       sqlList.add(" delete from transfers ");
/*      */ 
/*  829 */       StringBuffer sqlBuf = new StringBuffer();
/*  830 */       sqlBuf.append(" insert into transfers ( btscode,  btsname, transAF, SDHAF,");
/*  831 */       sqlBuf.append(" PDHAF, microwaveAF, otherAF, SDHAM, PDHAM,  microwaveAM, otherAM,");
/*  832 */       sqlBuf.append(" voltageA, propertyA, opentimeA, distODFAF, distDDFAF, distcomtankAF,");
/*  833 */       sqlBuf.append(" distotherAF, distODFAM, distDDFAM,  distcomtankAM, distotherAM,");
/*  834 */       sqlBuf.append(" ele2MCNum, ele2MUNum, ele2MAUNum, ele2MUidx,  ele2MUTimeSlot,  maintenance,");
/*  835 */       sqlBuf.append(" refreshtime, memo, 2MUseSta, portid,useinfo, isPowerAlone,registtime ) values  ");
/*      */ 
/*  837 */       int countNum = list.size();
/*  838 */       for (int i = 0; i < countNum; i++)
/*      */       {
/*  840 */         sqlBuf.append(" ( ");
/*  841 */         TransfersBO bo = (TransfersBO)list.get(i);
/*  842 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/*  843 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/*  844 */         sqlBuf.append(" '" + bo.getTransAF() + "' ,");
/*  845 */         sqlBuf.append(" '" + bo.getSDHAF() + "' ,");
/*  846 */         sqlBuf.append(" '" + bo.getPDHAF() + "' ,");
/*  847 */         sqlBuf.append(" '" + bo.getMicrowaveAF() + "' ,");
/*  848 */         sqlBuf.append(" '" + bo.getOtherAF() + "' ,");
/*  849 */         sqlBuf.append(" '" + bo.getSDHAM() + "' ,");
/*  850 */         sqlBuf.append(" '" + bo.getPDHAM() + "' ,");
/*  851 */         sqlBuf.append(" '" + bo.getMicrowaveAM() + "' ,");
/*  852 */         sqlBuf.append(" '" + bo.getOtherAM() + "' ,");
/*  853 */         sqlBuf.append(" '" + bo.getVoltageA() + "' ,");
/*  854 */         sqlBuf.append(" '" + bo.getPropertyA() + "' ,");
/*  855 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getOpentimeA()) + "' ,");
/*  856 */         sqlBuf.append(" '" + bo.getDistODFAF() + "' ,");
/*  857 */         sqlBuf.append(" '" + bo.getDistDDFAF() + "' ,");
/*  858 */         sqlBuf.append(" '" + bo.getDistcomtankAF() + "' ,");
/*  859 */         sqlBuf.append(" '" + bo.getDistotherAF() + "' ,");
/*  860 */         sqlBuf.append(" '" + bo.getDistODFAM() + "' ,");
/*  861 */         sqlBuf.append(" '" + bo.getDistDDFAM() + "' ,");
/*  862 */         sqlBuf.append(" '" + bo.getDistcomtankAM() + "' ,");
/*  863 */         sqlBuf.append(" '" + bo.getDistotherAM() + "' ,");
/*  864 */         sqlBuf.append(" '" + bo.getEle2MCNum() + "' ,");
/*  865 */         sqlBuf.append(" '" + bo.getEle2MUNum() + "' ,");
/*  866 */         sqlBuf.append(" '" + bo.getEle2MAUNum() + "' ,");
/*  867 */         sqlBuf.append(" '" + bo.getEle2MUidx() + "' ,");
/*  868 */         sqlBuf.append(" '" + bo.getEle2MUTimeSlot() + "' ,");
/*  869 */         sqlBuf.append(" '" + bo.getMaintenance() + "' ,");
/*  870 */         sqlBuf.append(" '" + this.sdf.format(bo.getRefreshtime()) + "' ,");
/*  871 */         sqlBuf.append(" '" + bo.getMemo() + "' ,");
/*  872 */         sqlBuf.append(" '" + bo.getStr2MUseSta() + "' ,");
/*  873 */         sqlBuf.append(" '" + bo.getPortid() + "' ,");
/*  874 */         sqlBuf.append(" '" + bo.getUseinfo() + "' ,");
/*  875 */         sqlBuf.append(" '" + bo.getIsPowerAlone() + "' ,");
/*  876 */         if (i == countNum - 1)
/*  877 */           sqlBuf.append(" '" + this.sdfNet.format(bo.getOpentimeA()) + "' );");
/*      */         else
/*  879 */           sqlBuf.append(" '" + this.sdfNet.format(bo.getOpentimeA()) + "' ),");
/*      */       }
/*  881 */       String strSQL = sqlBuf.toString();
/*  882 */       sqlList.add(strSQL);
/*  883 */       log.info(strSQL);
/*  884 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/*  888 */       flag = false;
/*  889 */       e.printStackTrace();
/*  890 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/*  893 */       closeAll();
/*      */     }
/*  895 */     log.info("批量导入--传输---结束");
/*  896 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importForMainssupplyData(List list)
/*      */   {
/*  901 */     log.info("批量导入--市电引入---开始");
/*  902 */     boolean flag = true;
/*      */     try
/*      */     {
/*  905 */       if ((list == null) || (list.size() < 1)) {
/*  906 */         throw new Exception("excel 没有【市电引入】数据");
/*      */       }
/*  908 */       List sqlList = new ArrayList();
/*  909 */       sqlList.add(" delete from mainssupply ");
/*      */ 
/*  912 */       StringBuffer sqlBuf = new StringBuffer();
/*  913 */       sqlBuf.append(" insert into mainssupply (btscode,  btsname, type, elecableTDLen,");
/*  914 */       sqlBuf.append(" elecableTDM, elecableTDT, elecableTDP, elecableLDLen, elecableLDM,");
/*  915 */       sqlBuf.append(" elecableLDT, elecableLDP, maintenance, refreshtime,registtime, memo  ) values  ");
/*      */ 
/*  917 */       int countNum = list.size();
/*  918 */       for (int i = 0; i < countNum; i++)
/*      */       {
/*  920 */         sqlBuf.append(" ( ");
/*  921 */         MainssupplyBO bo = (MainssupplyBO)list.get(i);
/*  922 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/*  923 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/*  924 */         sqlBuf.append(" '" + bo.getType() + "' ,");
/*  925 */         sqlBuf.append(" '" + bo.getElecableTDLen() + "' ,");
/*  926 */         sqlBuf.append(" '" + bo.getElecableTDM() + "' ,");
/*  927 */         sqlBuf.append(" '" + bo.getElecableTDT() + "' ,");
/*  928 */         sqlBuf.append(" '" + bo.getElecableTDP() + "' ,");
/*  929 */         sqlBuf.append(" '" + bo.getElecableLDLen() + "' ,");
/*  930 */         sqlBuf.append(" '" + bo.getElecableLDM() + "' ,");
/*  931 */         sqlBuf.append(" '" + bo.getElecableLDT() + "' ,");
/*  932 */         sqlBuf.append(" '" + bo.getElecableLDP() + "' ,");
/*  933 */         sqlBuf.append(" '" + bo.getMaintenance() + "' ,");
/*  934 */         sqlBuf.append(" '" + this.sdf.format(bo.getRefreshtime()) + "', ");
/*  935 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getRegisttime()) + "', ");
/*  936 */         if (i == countNum - 1)
/*  937 */           sqlBuf.append(" '" + bo.getMemo() + "' );");
/*      */         else
/*  939 */           sqlBuf.append(" '" + bo.getMemo() + "' ),");
/*      */       }
/*  941 */       String strSQL = sqlBuf.toString();
/*  942 */       sqlList.add(strSQL);
/*  943 */       log.info(strSQL);
/*  944 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/*  948 */       flag = false;
/*  949 */       e.printStackTrace();
/*  950 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/*  953 */       closeAll();
/*      */     }
/*  955 */     log.info("批量导入--市电引入---结束");
/*  956 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importForAntennaFeederData(List list)
/*      */   {
/*  961 */     log.info("批量导入--天馈---开始");
/*  962 */     boolean flag = true;
/*      */     try
/*      */     {
/*  965 */       if ((list == null) || (list.size() < 1)) {
/*  966 */         throw new Exception("excel 没有【天馈】数据");
/*      */       }
/*  968 */       List sqlList = new ArrayList();
/*  969 */       sqlList.add(" delete from antennafeeder ");
/*      */ 
/*  971 */       StringBuffer sqlBuf = new StringBuffer();
/*  972 */       sqlBuf.append(" insert into antennafeeder ( btscode,  btsname, antennaT, antennaM,  antennaNum,");
/*  973 */       sqlBuf.append(" antennaPlu,  antennaDir,  antennaPT, antennaFB, antennaH, antennaCRD, magnifierT,");
/*  974 */       sqlBuf.append(" magnifierM, magnifierNum,  magnifierCell, magnifierCRD, feederT, feederM,");
/*  975 */       sqlBuf.append(" feederLen, feederNum, maintenance, refreshtime, memo,");
/*  976 */       sqlBuf.append(" anteIsMakeAng, anteDicAng,registtime ,anteUpAng ) values  ");
/*      */ 
/*  978 */       int countNum = list.size();
/*  979 */       for (int i = 0; i < countNum; i++)
/*      */       {
/*  981 */         sqlBuf.append(" ( ");
/*      */ 
/*  983 */         AntennaFeederBO bo = (AntennaFeederBO)list.get(i);
/*  984 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/*  985 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/*  986 */         sqlBuf.append(" '" + bo.getAntennaT() + "' ,");
/*  987 */         sqlBuf.append(" '" + bo.getAntennaM() + "' ,");
/*  988 */         sqlBuf.append(" '" + bo.getAntennaNum() + "' ,");
/*  989 */         sqlBuf.append(" '" + bo.getAntennaPlu() + "' ,");
/*  990 */         sqlBuf.append(" '" + bo.getAntennaDir() + "' ,");
/*  991 */         sqlBuf.append(" '" + bo.getAntennaPT() + "' ,");
/*  992 */         sqlBuf.append(" '" + bo.getAntennaFB() + "' ,");
/*  993 */         sqlBuf.append(" '" + bo.getAntennaH() + "' ,");
/*  994 */         sqlBuf.append(" '" + bo.getAntennaCRD() + "' ,");
/*  995 */         sqlBuf.append(" '" + bo.getMagnifierT() + "' ,");
/*  996 */         sqlBuf.append(" '" + bo.getMagnifierM() + "' ,");
/*  997 */         sqlBuf.append(" '" + bo.getMagnifierNum() + "' ,");
/*  998 */         sqlBuf.append(" '" + bo.getMagnifierCell() + "' ,");
/*  999 */         sqlBuf.append(" '" + bo.getMagnifierCRD() + "' ,");
/* 1000 */         sqlBuf.append(" '" + bo.getFeederT() + "' ,");
/* 1001 */         sqlBuf.append(" '" + bo.getFeederM() + "' ,");
/* 1002 */         sqlBuf.append(" '" + bo.getFeederLen() + "' ,");
/* 1003 */         sqlBuf.append(" '" + bo.getFeederNum() + "' ,");
/* 1004 */         sqlBuf.append(" '" + bo.getMaintenance() + "' ,");
/* 1005 */         sqlBuf.append(" '" + this.sdf.format(bo.getRefreshtime()) + "' ,");
/* 1006 */         sqlBuf.append(" '" + bo.getMemo() + "' ,");
/* 1007 */         sqlBuf.append(" '" + bo.getAnteIsMakeAng() + "' ,");
/* 1008 */         sqlBuf.append(" '" + bo.getAnteDicAng() + "' ,");
/* 1009 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getRegisttime()) + "' ,");
/* 1010 */         if (i == countNum - 1)
/* 1011 */           sqlBuf.append(" '" + bo.getAnteUpAng() + "' );");
/*      */         else
/* 1013 */           sqlBuf.append(" '" + bo.getAnteUpAng() + "' ),");
/*      */       }
/* 1015 */       String strSQL = sqlBuf.toString();
/* 1016 */       sqlList.add(strSQL);
/* 1017 */       log.info(strSQL);
/* 1018 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/* 1023 */       flag = false;
/* 1024 */       e.printStackTrace();
/* 1025 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/* 1028 */       closeAll();
/*      */     }
/* 1030 */     log.info("批量导入--天馈---结束");
/* 1031 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importForIronTowerData(List list) {
/* 1035 */     log.info("批量导入--铁塔---开始");
/* 1036 */     boolean flag = true;
/*      */     try
/*      */     {
/* 1039 */       if ((list == null) || (list.size() < 1)) {
/* 1040 */         throw new Exception("excel 没有【铁塔】数据");
/*      */       }
/* 1042 */       List sqlList = new ArrayList();
/* 1043 */       sqlList.add(" delete from irontower ");
/*      */ 
/* 1046 */       StringBuffer sqlBuf = new StringBuffer();
/* 1047 */       sqlBuf.append(" insert into irontower ( btscode, btsname, property, registtime,");
/* 1048 */       sqlBuf.append(" fromunit, contact, telphone, type, height,  warnschilder, maintenance,");
/* 1049 */       sqlBuf.append(" refreshtime, memo, itowerPlatNum, itowerSta  ) values  ");
/*      */ 
/* 1051 */       int countNum = list.size();
/* 1052 */       for (int i = 0; i < countNum; i++)
/*      */       {
/* 1054 */         sqlBuf.append(" ( ");
/*      */ 
/* 1056 */         IronTowerBO bo = (IronTowerBO)list.get(i);
/* 1057 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/* 1058 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/* 1059 */         sqlBuf.append(" '" + bo.getProperty() + "' ,");
/* 1060 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getOpentime()) + "' ,");
/* 1061 */         sqlBuf.append(" '" + bo.getFromunit() + "' ,");
/* 1062 */         sqlBuf.append(" '" + bo.getContact() + "' ,");
/* 1063 */         sqlBuf.append(" '" + bo.getTelphone() + "' ,");
/* 1064 */         sqlBuf.append(" '" + bo.getType() + "' ,");
/* 1065 */         sqlBuf.append(" '" + bo.getHeight() + "' ,");
/* 1066 */         sqlBuf.append(" '" + bo.getWarnschilder() + "' ,");
/* 1067 */         sqlBuf.append(" '" + bo.getMaintenance() + "' ,");
/* 1068 */         sqlBuf.append(" '" + this.sdf.format(bo.getRefreshtime()) + "', ");
/* 1069 */         sqlBuf.append(" '" + bo.getMemo() + "' , ");
/* 1070 */         sqlBuf.append(" '" + bo.getItowerPlatNum() + "' , ");
/* 1071 */         if (i == countNum - 1)
/* 1072 */           sqlBuf.append(" '" + bo.getItowerSta() + "' ); ");
/*      */         else
/* 1074 */           sqlBuf.append(" '" + bo.getItowerSta() + "' ), ");
/*      */       }
/* 1076 */       String strSQL = sqlBuf.toString();
/* 1077 */       sqlList.add(strSQL);
/* 1078 */       log.info(strSQL);
/* 1079 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/* 1083 */       flag = false;
/* 1084 */       e.printStackTrace();
/* 1085 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/* 1088 */       closeAll();
/*      */     }
/* 1090 */     log.info("批量导入--铁塔---结束");
/* 1091 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importForMachineRoomData(List list)
/*      */   {
/* 1096 */     log.info("批量导入--机房---开始");
/* 1097 */     boolean flag = true;
/*      */     try
/*      */     {
/* 1100 */       if ((list == null) || (list.size() < 1)) {
/* 1101 */         throw new Exception("excel 没有【机房】数据");
/*      */       }
/* 1103 */       List sqlList = new ArrayList();
/* 1104 */       sqlList.add(" delete from machineroom ");
/*      */ 
/* 1107 */       StringBuffer sqlBuf = new StringBuffer();
/* 1108 */       sqlBuf.append(" insert into machineroom ( btscode, btsname, frame,  acreageT,");
/* 1109 */       sqlBuf.append(" plan, property, fromunit, other, contact, telphone, registtime,");
/* 1110 */       sqlBuf.append(" wallheight, doortype, facility, reason, warnschilder, acreageU,");
/* 1111 */       sqlBuf.append(" place, maintenance, refreshtime, memo, mroomIsLook,");
/* 1112 */       sqlBuf.append(" mroomLookTel   ) values  ");
/*      */ 
/* 1114 */       int countNum = list.size();
/* 1115 */       for (int i = 0; i < countNum; i++)
/*      */       {
/* 1117 */         sqlBuf.append(" ( ");
/*      */ 
/* 1119 */         MachineRoomBO bo = (MachineRoomBO)list.get(i);
/* 1120 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/* 1121 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/* 1122 */         sqlBuf.append(" '" + bo.getFrame() + "' ,");
/* 1123 */         sqlBuf.append(" '" + bo.getAcreageT() + "' ,");
/* 1124 */         sqlBuf.append(" '" + bo.getPlan() + "' ,");
/* 1125 */         sqlBuf.append(" '" + bo.getProperty() + "' ,");
/* 1126 */         sqlBuf.append(" '" + bo.getFromunit() + "' ,");
/* 1127 */         sqlBuf.append(" '" + bo.getOther() + "' ,");
/* 1128 */         sqlBuf.append(" '" + bo.getContact() + "' ,");
/* 1129 */         sqlBuf.append(" '" + bo.getTelphone() + "' ,");
/* 1130 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getOpentime()) + "' ,");
/* 1131 */         sqlBuf.append(" '" + bo.getWallheight() + "' ,");
/* 1132 */         sqlBuf.append(" '" + bo.getDoortype() + "' ,");
/* 1133 */         sqlBuf.append(" '" + bo.getFacility() + "' ,");
/* 1134 */         sqlBuf.append(" '" + bo.getReason() + "' ,");
/* 1135 */         sqlBuf.append(" '" + bo.getWarnschilder() + "' ,");
/* 1136 */         sqlBuf.append(" '" + bo.getAcreageU() + "' ,");
/* 1137 */         sqlBuf.append(" '" + bo.getPlace() + "' ,");
/* 1138 */         sqlBuf.append(" '" + bo.getMaintenance() + "' ,");
/*      */ 
/* 1140 */         sqlBuf.append(" '" + this.sdf.format(bo.getRefreshtime()) + "' ,");
/* 1141 */         sqlBuf.append(" '" + bo.getMemo() + "' ,");
/* 1142 */         sqlBuf.append(" '" + bo.getMroomIsLook() + "' ,");
/* 1143 */         if (i == countNum - 1)
/* 1144 */           sqlBuf.append(" '" + bo.getMroomLookTel() + "' );");
/*      */         else
/* 1146 */           sqlBuf.append(" '" + bo.getMroomLookTel() + "' ),");
/*      */       }
/* 1148 */       String strSQL = sqlBuf.toString();
/* 1149 */       sqlList.add(strSQL);
/* 1150 */       log.info(strSQL);
/* 1151 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/* 1156 */       flag = false;
/* 1157 */       e.printStackTrace();
/* 1158 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/* 1161 */       closeAll();
/*      */     }
/* 1163 */     log.info("批量导入--机房---结束");
/* 1164 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importForPowerSupplyData(List list)
/*      */   {
/* 1169 */     log.info("批量导入--基础供电归属---开始");
/* 1170 */     boolean flag = true;
/*      */     try
/*      */     {
/* 1173 */       if ((list == null) || (list.size() < 1)) {
/* 1174 */         throw new Exception("excel 没有【基础供电归属】数据");
/*      */       }
/* 1176 */       List sqlList = new ArrayList();
/* 1177 */       sqlList.add(" delete from powersupply ");
/*      */ 
/* 1179 */       StringBuffer sqlBuf = new StringBuffer();
/* 1180 */       sqlBuf.append(" insert into powersupply ( btscode,  btsname, powersupply,  pstelephone,");
/* 1181 */       sqlBuf.append(" contact, telephone, refreshtime,registtime, memo   ) values  ");
/*      */ 
/* 1183 */       int countNum = list.size();
/* 1184 */       for (int i = 0; i < countNum; i++)
/*      */       {
/* 1186 */         sqlBuf.append(" ( ");
/*      */ 
/* 1188 */         PowerSupplyBO bo = (PowerSupplyBO)list.get(i);
/* 1189 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/* 1190 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/* 1191 */         sqlBuf.append(" '" + bo.getPowersupply() + "' ,");
/* 1192 */         sqlBuf.append(" '" + bo.getPstelephone() + "' ,");
/* 1193 */         sqlBuf.append(" '" + bo.getContact() + "' ,");
/* 1194 */         sqlBuf.append(" '" + bo.getTelephone() + "' ,");
/* 1195 */         sqlBuf.append(" '" + this.sdf.format(bo.getRefreshtime()) + "' ,");
/* 1196 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getRegisttime()) + "' ,");
/* 1197 */         if (i == countNum - 1)
/* 1198 */           sqlBuf.append(" '" + bo.getMemo() + "' );");
/*      */         else
/* 1200 */           sqlBuf.append(" '" + bo.getMemo() + "' ),");
/*      */       }
/* 1202 */       String strSQL = sqlBuf.toString();
/* 1203 */       sqlList.add(strSQL);
/* 1204 */       log.info(strSQL);
/* 1205 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/* 1209 */       flag = false;
/* 1210 */       e.printStackTrace();
/* 1211 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/* 1214 */       closeAll();
/*      */     }
/* 1216 */     log.info("批量导入--基础供电归属---结束");
/* 1217 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importForTrafficInfoData(List list) {
/* 1221 */     log.info("批量导入--交通状况---开始");
/* 1222 */     boolean flag = true;
/*      */     try
/*      */     {
/* 1225 */       if ((list == null) || (list.size() < 1)) {
/* 1226 */         throw new Exception("excel 没有【交通状况】数据");
/*      */       }
/* 1228 */       List sqlList = new ArrayList();
/* 1229 */       sqlList.add(" delete from trafficinfo ");
/*      */ 
/* 1231 */       StringBuffer sqlBuf = new StringBuffer();
/* 1232 */       sqlBuf.append(" insert into trafficinfo ( btscode, btsname, road,roadway,");
/* 1233 */       sqlBuf.append(" distanceC, arrivaltimeC, distanceP, arrivaltimeP,");
/* 1234 */       sqlBuf.append(" refreshtime,registtime, memo ) values  ");
/*      */ 
/* 1236 */       int countNum = list.size();
/* 1237 */       for (int i = 0; i < countNum; i++)
/*      */       {
/* 1239 */         sqlBuf.append(" ( ");
/*      */ 
/* 1241 */         TrafficInfoBO bo = (TrafficInfoBO)list.get(i);
/* 1242 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/* 1243 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/* 1244 */         sqlBuf.append(" '" + bo.getRoad() + "' ,");
/* 1245 */         sqlBuf.append(" '" + bo.getRoadway() + "' ,");
/* 1246 */         sqlBuf.append(" '" + bo.getDistanceC() + "' ,");
/* 1247 */         sqlBuf.append(" '" + bo.getArrivaltimeC() + "' ,");
/* 1248 */         sqlBuf.append(" '" + bo.getDistanceP() + "' ,");
/* 1249 */         sqlBuf.append(" '" + bo.getArrivaltimeP() + "' ,");
/* 1250 */         sqlBuf.append(" '" + this.sdf.format(bo.getRefreshtime()) + "' ,");
/* 1251 */         sqlBuf.append(" '" + this.sdfNet.format(bo.getRegisttime()) + "' ,");
/* 1252 */         if (i == countNum - 1)
/* 1253 */           sqlBuf.append(" '" + bo.getMemo() + "' );");
/*      */         else
/* 1255 */           sqlBuf.append(" '" + bo.getMemo() + "' ),");
/*      */       }
/* 1257 */       String strSQL = sqlBuf.toString();
/* 1258 */       sqlList.add(strSQL);
/* 1259 */       log.info(strSQL);
/* 1260 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/* 1264 */       flag = false;
/* 1265 */       e.printStackTrace();
/* 1266 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/* 1269 */       closeAll();
/*      */     }
/* 1271 */     log.info("批量导入--交通状况---结束");
/* 1272 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importForEnvData(List list) {
/* 1276 */     log.info("批量导入--地理环境---开始");
/* 1277 */     boolean flag = true;
/*      */     try
/*      */     {
/* 1280 */       if ((list == null) || (list.size() < 1)) {
/* 1281 */         throw new Exception("excel 没有【地理环境】数据");
/*      */       }
/* 1283 */       List sqlList = new ArrayList();
/* 1284 */       sqlList.add(" delete from geographicalenv ");
/*      */ 
/* 1287 */       StringBuffer sqlBuf = new StringBuffer();
/* 1288 */       sqlBuf.append(" insert into geographicalenv (  btscode,  btsname, btszone, landform, lng, ");
/* 1289 */       sqlBuf.append(" lat, relocationrd, username, distcode, btslevel, workingradius, ");
/* 1290 */       sqlBuf.append("  refreshtime,  memo, graphDeatilAddr,  graphHigh,trannetid , ");
/* 1291 */       sqlBuf.append("  trannetname,  trannetgrade, registtime,  btskind,btstype,coverage,maintype ) values  ");
/*      */ 
/* 1293 */       int countNum = list.size();
/* 1294 */       for (int i = 0; i < countNum; i++)
/*      */       {
/* 1296 */         sqlBuf.append(" ( ");
/* 1297 */         GeographicalenvBo bo = (GeographicalenvBo)list.get(i);
/*      */ 
/* 1299 */         sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/* 1300 */         sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/* 1301 */         sqlBuf.append(" '" + bo.getBtszone() + "' ,");
/* 1302 */         sqlBuf.append(" '" + bo.getLandform() + "' ,");
/* 1303 */         sqlBuf.append(" '" + bo.getLng() + "' ,");
/* 1304 */         sqlBuf.append(" '" + bo.getLat() + "' ,");
/* 1305 */         sqlBuf.append(" '" + bo.getRelocationrd() + "' ,");
/* 1306 */         sqlBuf.append(" '" + bo.getUsername() + "' ,");
/* 1307 */         sqlBuf.append(" '" + bo.getDistcode() + "' ,");
/* 1308 */         sqlBuf.append(" '" + bo.getBtslevel() + "' ,");
/* 1309 */         sqlBuf.append(" '" + bo.getWorkingradius() + "' ,");
/* 1310 */         sqlBuf.append(" '" + this.sdf.format(bo.getRefreshtime()) + "' ,");
/* 1311 */         sqlBuf.append(" '" + bo.getMemo() + "' ,");
/* 1312 */         sqlBuf.append(" '" + bo.getGraphDeatilAddr() + "' ,");
/* 1313 */         sqlBuf.append(" '" + bo.getGraphHigh() + "' ,");
/*      */ 
/* 1315 */         sqlBuf.append(" '" + bo.getTrannetid() + "' ,");
/* 1316 */         sqlBuf.append(" '" + bo.getTrannetname() + "' ,");
/* 1317 */         sqlBuf.append(" '" + bo.getTrannetgrade() + "' ,");
/* 1318 */         sqlBuf.append(" '" + this.sdf.format(bo.getRegisttime()) + "' ,");
/* 1319 */         sqlBuf.append(" '" + bo.getBtskind() + "' ,");
/* 1320 */         sqlBuf.append(" '" + bo.getBtstype() + "' ,");
/* 1321 */         sqlBuf.append(" '" + bo.getCoverage() + "' ,");
/* 1322 */         if (i == countNum - 1)
/* 1323 */           sqlBuf.append(" '" + bo.getMaintype() + "' );");
/*      */         else {
/* 1325 */           sqlBuf.append(" '" + bo.getMaintype() + "' ),");
/*      */         }
/*      */       }
/* 1328 */       String strSQL = sqlBuf.toString();
/* 1329 */       sqlList.add(strSQL);
/* 1330 */       log.info(strSQL);
/* 1331 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/* 1335 */       flag = false;
/* 1336 */       e.printStackTrace();
/* 1337 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/* 1340 */       closeAll();
/* 1341 */       log.info("批量导入--地理环境---结束");
/*      */     }
/* 1343 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importForSectionTotalInfoData(List list)
/*      */   {
/* 1348 */     log.info("批量导入--中继段【中继段】---开始");
/* 1349 */     boolean flag = true;
/*      */     try
/*      */     {
/* 1352 */       if ((list == null) || (list.size() < 1)) {
/* 1353 */         throw new Exception("excel 没有【中继段】数据");
/*      */       }
/* 1355 */       List sqlList = new ArrayList();
/* 1356 */       sqlList.add(" delete from sectiontotalinfo ");
/*      */ 
/* 1359 */       StringBuffer sqlBuf = new StringBuffer();
/* 1360 */       sqlBuf.append(" insert into sectiontotalinfo (OcID,linkID,OcName,ocBeginName,ocBeginLng,ocBeginLat,ocEndName, ");
/* 1361 */       sqlBuf.append(" ocEndLng,ocEndLat,ocType,ocNum,ocLength,ocInspectorName,notes,userid,refreshtime,ocInspectorPhone) values  ");
/* 1362 */       int countNum = list.size();
/* 1363 */       for (int i = 0; i < countNum; i++)
/*      */       {
/* 1365 */         sqlBuf.append(" ( ");
/* 1366 */         SectionInfoBo bo = (SectionInfoBo)list.get(i);
/*      */ 
/* 1368 */         sqlBuf.append("'" + bo.getOcID() + "',");
/* 1369 */         sqlBuf.append("'" + bo.getLinkID() + "',");
/* 1370 */         sqlBuf.append("'" + bo.getOcName() + "',");
/* 1371 */         sqlBuf.append("'" + bo.getOcBeginName() + "',");
/* 1372 */         sqlBuf.append("'" + bo.getOcBeginLng() + "',");
/* 1373 */         sqlBuf.append("'" + bo.getOcBeginLat() + "',");
/* 1374 */         sqlBuf.append("'" + bo.getOcEndName() + "',");
/* 1375 */         sqlBuf.append("'" + bo.getOcEndLng() + "',");
/* 1376 */         sqlBuf.append("'" + bo.getOcEndLat() + "',");
/* 1377 */         sqlBuf.append("'" + bo.getOcType() + "',");
/* 1378 */         sqlBuf.append("'" + bo.getOcNum() + "',");
/* 1379 */         sqlBuf.append("'" + bo.getOcLength() + "',");
/* 1380 */         sqlBuf.append("'" + bo.getOcInspectorName() + "',");
/* 1381 */         sqlBuf.append("'" + bo.getNotes() + "',");
/* 1382 */         sqlBuf.append("'" + bo.getUserId() + "',");
/* 1383 */         sqlBuf.append("'" + this.sdf.format(bo.getRefreshtime()) + "',");
/* 1384 */         if (i == countNum - 1)
/* 1385 */           sqlBuf.append(" '" + bo.getOcInspectorPhone() + "' );");
/*      */         else {
/* 1387 */           sqlBuf.append(" '" + bo.getOcInspectorPhone() + "' ),");
/*      */         }
/*      */       }
/* 1390 */       String strSQL = sqlBuf.toString();
/* 1391 */       sqlList.add(strSQL);
/* 1392 */       log.info(strSQL);
/* 1393 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/* 1397 */       flag = false;
/* 1398 */       e.printStackTrace();
/* 1399 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/* 1402 */       closeAll();
/* 1403 */       log.info("批量导入--中继段【中继段】---结束");
/*      */     }
/* 1405 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importForFiberInfoData(List list)
/*      */   {
/* 1410 */     log.info("批量导入--中继段【基本信息】---开始");
/* 1411 */     boolean flag = true;
/*      */     try
/*      */     {
/* 1414 */       if ((list == null) || (list.size() < 1)) {
/* 1415 */         throw new Exception("excel 没有【基本信息】数据");
/*      */       }
/* 1417 */       List sqlList = new ArrayList();
/* 1418 */       sqlList.add(" delete from fiberinfo ");
/*      */ 
/* 1421 */       StringBuffer sqlBuf = new StringBuffer();
/* 1422 */       sqlBuf.append(" insert into fiberinfo (fiberid,ocid,OcName,btsName,ocLayType,ocNum,ocLength,wavelength,refractive,instrumentName,post,tester,testTime) values ");
/* 1423 */       int countNum = list.size();
/* 1424 */       for (int i = 0; i < countNum; i++)
/*      */       {
/* 1426 */         sqlBuf.append(" ( ");
/* 1427 */         FiberInfoBO bo = (FiberInfoBO)list.get(i);
/*      */ 
/* 1429 */         sqlBuf.append("'" + bo.getFiberid() + "',");
/* 1430 */         sqlBuf.append("'" + bo.getOcid() + "',");
/* 1431 */         sqlBuf.append("'" + bo.getOcName() + "',");
/* 1432 */         sqlBuf.append("'" + bo.getBtsName() + "',");
/* 1433 */         sqlBuf.append("'" + bo.getOcLayType() + "',");
/* 1434 */         sqlBuf.append("'" + bo.getOcNum() + "',");
/* 1435 */         sqlBuf.append("'" + bo.getOcLength() + "',");
/* 1436 */         sqlBuf.append("'" + bo.getWavelength() + "',");
/* 1437 */         sqlBuf.append("'" + bo.getRefractive() + "',");
/* 1438 */         sqlBuf.append("'" + bo.getInstrumentName() + "',");
/* 1439 */         sqlBuf.append("'" + bo.getPost() + "',");
/* 1440 */         sqlBuf.append("'" + bo.getTester() + "',");
/*      */ 
/* 1442 */         if (i == countNum - 1)
/* 1443 */           sqlBuf.append("'" + bo.getTestTime() + "' );");
/*      */         else {
/* 1445 */           sqlBuf.append("'" + bo.getTestTime() + "' ),");
/*      */         }
/*      */       }
/* 1448 */       String strSQL = sqlBuf.toString();
/* 1449 */       sqlList.add(strSQL);
/* 1450 */       log.info(strSQL);
/* 1451 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/* 1455 */       flag = false;
/* 1456 */       e.printStackTrace();
/* 1457 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/* 1460 */       closeAll();
/* 1461 */       log.info("批量导入--中继段【基本信息】---结束");
/*      */     }
/* 1463 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importForOutInfoData(List list)
/*      */   {
/* 1468 */     log.info("批量导入--中继段【户外信息】---开始");
/* 1469 */     boolean flag = true;
/*      */     try
/*      */     {
/* 1472 */       if ((list == null) || (list.size() < 1)) {
/* 1473 */         throw new Exception("excel 没有【户外信息】数据");
/*      */       }
/* 1475 */       List sqlList = new ArrayList();
/* 1476 */       sqlList.add(" delete from sectionoutinfo ");
/*      */ 
/* 1479 */       StringBuffer sqlBuf = new StringBuffer();
/* 1480 */       sqlBuf.append(" insert into sectionoutinfo (id,outOrder,ocid,OcName,poleNum,propertyRight,Longleath1,Longleath2,");
/* 1481 */       sqlBuf.append(" lng,lat,distance,isNode,isJoint,isRes,resLength,updateTime,ocLayType,routeInfo,granularity,previousid,lightningprotection,wiredrawing,strutnum,zone ) values  ");
/* 1482 */       int countNum = list.size();
/* 1483 */       for (int i = 0; i < countNum; i++)
/*      */       {
/* 1485 */         sqlBuf.append(" ( ");
/* 1486 */         SectionOutInfoBO bo = (SectionOutInfoBO)list.get(i);
/*      */ 
/* 1488 */         sqlBuf.append("'" + bo.getId() + "',");
/* 1489 */         sqlBuf.append("'" + bo.getOutOrder() + "',");
/* 1490 */         sqlBuf.append("'" + bo.getOcid() + "',");
/* 1491 */         sqlBuf.append("'" + bo.getOcName() + "',");
/* 1492 */         sqlBuf.append("'" + bo.getPoleNum() + "',");
/* 1493 */         sqlBuf.append("'" + bo.getPropertyRight() + "',");
/* 1494 */         sqlBuf.append("'" + bo.getLongleath1() + "',");
/* 1495 */         sqlBuf.append("'" + bo.getLongleath2() + "',");
/* 1496 */         sqlBuf.append("'" + bo.getLng() + "',");
/* 1497 */         sqlBuf.append("'" + bo.getLat() + "',");
/* 1498 */         sqlBuf.append("'" + bo.getDistance() + "',");
/* 1499 */         sqlBuf.append("'" + bo.getIsNode() + "',");
/* 1500 */         sqlBuf.append("'" + bo.getIsJoint() + "',");
/* 1501 */         sqlBuf.append("'" + bo.getIsRes() + "',");
/* 1502 */         sqlBuf.append("'" + bo.getResLength() + "',");
/* 1503 */         sqlBuf.append("'" + this.sdf.format(bo.getUpdateTime()) + "',");
/* 1504 */         sqlBuf.append("'" + bo.getOcLayType() + "',");
/* 1505 */         sqlBuf.append("'" + bo.getRouteInfo() + "' ,");
/* 1506 */         sqlBuf.append("'" + bo.getGranularity() + "' ,");
/*      */ 
/* 1508 */         sqlBuf.append("'" + bo.getPreviousid() + "' ,");
/* 1509 */         sqlBuf.append("'" + bo.getLightningprotection() + "' ,");
/* 1510 */         sqlBuf.append("'" + bo.getWiredrawing() + "' ,");
/* 1511 */         sqlBuf.append("'" + bo.getStrutnum() + "' ,");
/* 1512 */         if (i == countNum - 1)
/* 1513 */           sqlBuf.append("'" + bo.getZone() + "' );");
/*      */         else {
/* 1515 */           sqlBuf.append("'" + bo.getZone() + "' ),");
/*      */         }
/*      */       }
/* 1518 */       String strSQL = sqlBuf.toString();
/* 1519 */       sqlList.add(strSQL);
/* 1520 */       log.info(strSQL);
/* 1521 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/* 1525 */       flag = false;
/* 1526 */       e.printStackTrace();
/* 1527 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/* 1530 */       closeAll();
/* 1531 */       log.info("批量导入--中继段【户外信息】---结束");
/*      */     }
/* 1533 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importFiberUsedInfoData(List list) {
/* 1537 */     log.info("批量导入--中继段【纤芯使用情况】---开始");
/* 1538 */     boolean flag = true;
/*      */     try
/*      */     {
/* 1541 */       if ((list == null) || (list.size() < 1)) {
/* 1542 */         throw new Exception("excel 没有【纤芯使用情况】数据");
/*      */       }
/* 1544 */       List sqlList = new ArrayList();
/* 1545 */       sqlList.add(" delete from fiberusedinfo ");
/*      */ 
/* 1548 */       StringBuffer sqlBuf = new StringBuffer();
/* 1549 */       sqlBuf.append(" insert into fiberusedinfo (id,no,fiberid,testDirection,decibel,allDb,beginPosition,beginMachineType,direction,endPosition,endMachineType ) values ");
/* 1550 */       int countNum = list.size();
/* 1551 */       for (int i = 0; i < countNum; i++)
/*      */       {
/* 1553 */         sqlBuf.append(" ( ");
/* 1554 */         FiberUsedInfoBO bo = (FiberUsedInfoBO)list.get(i);
/* 1555 */         sqlBuf.append("'" + bo.getId() + "',");
/* 1556 */         sqlBuf.append("'" + bo.getNo() + "',");
/* 1557 */         sqlBuf.append("'" + bo.getFiberid() + "',");
/* 1558 */         sqlBuf.append("'" + bo.getTestDirection() + "',");
/* 1559 */         sqlBuf.append("'" + bo.getDecibel() + "',");
/* 1560 */         sqlBuf.append("'" + bo.getAllDb() + "',");
/* 1561 */         sqlBuf.append("'" + bo.getBeginPosition() + "',");
/* 1562 */         sqlBuf.append("'" + bo.getBeginMachineType() + "',");
/* 1563 */         sqlBuf.append("'" + bo.getDirection() + "',");
/* 1564 */         sqlBuf.append("'" + bo.getEndPosition() + "',");
/*      */ 
/* 1566 */         if (i == countNum - 1)
/* 1567 */           sqlBuf.append("'" + bo.getEndMachineType() + "' );");
/*      */         else {
/* 1569 */           sqlBuf.append("'" + bo.getEndMachineType() + "' ),");
/*      */         }
/*      */       }
/* 1572 */       String strSQL = sqlBuf.toString();
/* 1573 */       sqlList.add(strSQL);
/* 1574 */       log.info(strSQL);
/* 1575 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/* 1579 */       flag = false;
/* 1580 */       e.printStackTrace();
/* 1581 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/* 1584 */       closeAll();
/* 1585 */       log.info("批量导入--中继段【纤芯使用情况】---结束");
/*      */     }
/* 1587 */     return flag;
/*      */   }
/*      */ 
/*      */   public boolean importUsedFiberMapData(List list) {
/* 1591 */     log.info("批量导入--中继段【纤芯使用对照】---开始");
/* 1592 */     boolean flag = true;
/*      */     try
/*      */     {
/* 1595 */       if ((list == null) || (list.size() < 1)) {
/* 1596 */         throw new Exception("excel 没有【纤芯使用对照】数据");
/*      */       }
/* 1598 */       List sqlList = new ArrayList();
/* 1599 */       sqlList.add(" delete from usedfibermap ");
/*      */ 
/* 1602 */       StringBuffer sqlBuf = new StringBuffer();
/* 1603 */       sqlBuf.append("insert into usedfibermap ( ");
/* 1604 */       sqlBuf.append(" ocid,ocName,a_netid,a_panelid,a_fiber_id, ");
/* 1605 */       sqlBuf.append(" a_usedinfo,b_netid,b_panelid,b_fiber_id, ");
/* 1606 */       sqlBuf.append(" b_usedinfo, a_station,b_station,direction ");
/* 1607 */       sqlBuf.append(" ) values   ");
/* 1608 */       int countNum = list.size();
/* 1609 */       for (int i = 0; i < countNum; i++)
/*      */       {
/* 1611 */         sqlBuf.append(" ( ");
/* 1612 */         UsedFiberMapBO bo = (UsedFiberMapBO)list.get(i);
/* 1613 */         sqlBuf.append(" '" + bo.getOcid() + "',");
/* 1614 */         sqlBuf.append(" '" + bo.getOcName() + "',");
/* 1615 */         sqlBuf.append(" '" + bo.getA_netid() + "',");
/* 1616 */         sqlBuf.append(" '" + bo.getA_panelid() + "',");
/* 1617 */         sqlBuf.append(" '" + bo.getA_fiber_id() + "',");
/* 1618 */         sqlBuf.append(" '" + bo.getA_usedinfo() + "',");
/* 1619 */         sqlBuf.append(" '" + bo.getB_netid() + "',");
/* 1620 */         sqlBuf.append(" '" + bo.getB_panelid() + "',");
/* 1621 */         sqlBuf.append(" '" + bo.getB_fiber_id() + "',");
/* 1622 */         sqlBuf.append(" '" + bo.getB_usedinfo() + "',");
/* 1623 */         sqlBuf.append(" '" + bo.getA_station() + "',");
/* 1624 */         sqlBuf.append(" '" + bo.getB_station() + "',");
/*      */ 
/* 1626 */         if (i == countNum - 1)
/* 1627 */           sqlBuf.append("'" + bo.getDirection() + "' );");
/*      */         else {
/* 1629 */           sqlBuf.append("'" + bo.getDirection() + "' ),");
/*      */         }
/*      */       }
/* 1632 */       String strSQL = sqlBuf.toString();
/* 1633 */       sqlList.add(strSQL);
/* 1634 */       log.info(strSQL);
/* 1635 */       executeBatch(sqlList);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/* 1639 */       flag = false;
/* 1640 */       e.printStackTrace();
/* 1641 */       log.error(e.getMessage());
/*      */     }
/*      */     finally {
/* 1644 */       closeAll();
/* 1645 */       log.info("批量导入--中继段【纤芯使用情况】---结束");
/*      */     }
/* 1647 */     return flag;
/*      */   }
/*      */ }

/* Location:           E:\java\apache-tomcat-6.0.36\webapps\btsm\WEB-INF\classes\
 * Qualified Name:     com.yc.dao.importdata.ImportDAO
 * JD-Core Version:    0.6.2
 */